<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
import { mapState, mapMutations} from 'vuex'
export default {
  data() {
    return {
      
    }
  },
  created() {
    let data = localStorage.getItem('zd_sky')
    let lang = localStorage.getItem('lang')
    if(lang) {
      this.setLang(lang)
    }
    if(data) {
      data = JSON.parse(data)
      let model = [
          {
            id: '',
            name: this.$t("请选择设备型号"),
            num: 0
          },
          ...data.equipment
        ]
      this.setToken(data.token)
      this.setCode(data.ocode)
      this.setMenu(data.menu)
      this.setPermissions(data.permissions)
      this.setEquipmentModel(model)
      this.setUid(data.uid)
      this.setName(data.name)
      this.setMemusid(data.memusid)
      

    }
  },
  methods: {
    ...mapMutations(['setMemusid','setUid','setName','setToken', 'setCode', 'setMenu', 'setPermissions', 'setLang', 'setEquipmentModel']),
  },
}
</script>

<style>
@import url("./assets/css/common.css");
html,
body{
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}
#app {
  width: 100%;
  min-width: 1200px;
  height: 100%;
  font-size: 13px;
  color: #303133;
  font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
</style>
